home *** CD-ROM | disk | FTP | other *** search
/ 3D Game Programming All in One / 3D Game Programming All in One Disc.iso / 3D2E / demo / server / scripts / commands.cs < prev    next >
Text File  |  2005-11-23  |  2KB  |  65 lines

  1. //-----------------------------------------------------------------------------
  2. // Torque Game Engine 
  3. // Copyright (C) GarageGames.com, Inc.
  4. //-----------------------------------------------------------------------------
  5.  
  6. //-----------------------------------------------------------------------------
  7. // Misc. server commands avialable to clients
  8. //-----------------------------------------------------------------------------
  9.  
  10. //-----------------------------------------------------------------------------
  11.  
  12. function serverCmdToggleCamera(%client)
  13. {
  14.    %control = %client.getControlObject();
  15.    if (%control == %client.player)
  16.    {
  17.       %control = %client.camera;
  18.       %control.mode = toggleCameraFly;
  19.    }
  20.    else
  21.    {
  22.       %control = %client.player;
  23.       %control.mode = observerFly;
  24.    }
  25.    %client.setControlObject(%control);
  26. }
  27.  
  28. function serverCmdDropPlayerAtCamera(%client)
  29. {
  30.    if ($Server::TestCheats || isObject(EditorGui))
  31.    {
  32.       %client.player.setTransform(%client.camera.getTransform());
  33.       %client.player.setVelocity("0 0 0");
  34.       %client.setControlObject(%client.player);
  35.    }
  36. }
  37.  
  38. function serverCmdDropCameraAtPlayer(%client)
  39. {
  40.    %client.camera.setTransform(%client.player.getEyeTransform());
  41.    %client.camera.setVelocity("0 0 0");
  42.    %client.setControlObject(%client.camera);
  43. }
  44.  
  45.  
  46. //-----------------------------------------------------------------------------
  47.  
  48. function serverCmdSuicide(%client)
  49. {
  50.    if (isObject(%client.player))
  51.       %client.player.kill("Suicide");
  52. }   
  53.  
  54. function serverCmdPlayCel(%client,%anim)
  55. {
  56.    if (isObject(%client.player))
  57.       %client.player.playCelAnimation(%anim);
  58. }
  59.  
  60. function serverCmdPlayDeath(%client)
  61. {
  62.    if (isObject(%client.player))
  63.       %client.player.playDeathAnimation();
  64. }
  65.